import rxAjax from '@/assets/js/ajax.js';

//大屏收藏记录 api接口
export const ScreenCollectRecordApi = {};

ScreenCollectRecordApi.baseUrl= '/api-screen/screen/core/screenCollectRecord';
ScreenCollectRecordApi.exportUrl= ScreenCollectRecordApi.baseUrl + '/listExport';

//查询列表
ScreenCollectRecordApi.query=function (parameter) {
  let url= ScreenCollectRecordApi.baseUrl + '/query';
  return rxAjax.postJson(url,parameter).then (res => {
    return res.result
  })
}

/**
* 获取单记录
* @param pkId
* @returns {*}
*/
ScreenCollectRecordApi.get =function(pkId) {
  let url= ScreenCollectRecordApi.baseUrl + '/get?pkId=' + pkId;
  return rxAjax.get(url);
}

//保存数据
ScreenCollectRecordApi.save =function(parameter) {
  let url= ScreenCollectRecordApi.baseUrl + '/save';
  return rxAjax.postJson(url,parameter);
}

//删除数据
ScreenCollectRecordApi.del =function(parameter) {
  let url= ScreenCollectRecordApi.baseUrl + '/del';
  return rxAjax.postUrl(url,parameter);
}

//获取我的收藏记录
ScreenCollectRecordApi.getMyCollectRecord =function(appId) {
	let url= ScreenCollectRecordApi.baseUrl + '/getMyCollectRecord?appId='+appId;
	return rxAjax.get(url);
}

//新增收藏
ScreenCollectRecordApi.addCollect =function(screenId) {
	let url= ScreenCollectRecordApi.baseUrl + '/addCollect?screenId='+screenId;
	return rxAjax.get(url);
}
//取消收藏
ScreenCollectRecordApi.unCollect =function(screenId) {
	let url= ScreenCollectRecordApi.baseUrl + '/unCollect?screenId='+screenId;
	return rxAjax.get(url);
}


export  default ScreenCollectRecordApi;

